/**
 * Created with JetBrains WebStorm.
 * User: 可乐加糖
 * Date: 13-7-28
 * Time: 下午11:45
 * To change this template use File | Settings | File Templates.
 */

var http = require("http"),
    assert = require("assert");

var opts = {
    host:'localhost',
    port:8000,
    path:'/send',
    method:'post',
    headers:{'content-type':'application/x-www-form-urlencoded'}
}

var req = http.request(opts,function(res){
    res.setEncoding('utf8');
    var data = "";

    res.on('data',function(d){
        data += d;
    });

    res.on('end',function(){
        assert.strictEqual(data,'{"status":"ok","message":"Tweet eceived"}');
    });
    req.write("tweet=test");
    req.end();
})
